package com.hui.demo.utils;

import java.util.ResourceBundle;

public class PropertiesUtils {


    /**
     * 从默认文件获取配置
     * @param key key值
     * @return String 配置
     */
    public static final String getKey (String key) {
        ResourceBundle resource = ResourceBundle.getBundle("config/alipay");
        return resource.getString(key);
    }

    /**
     * 从目标文件获取配置
     * @param file 目标文件路径
     * @param key key值
     * @return String 配置
     */
    public static final String getValueFromTarget (String file, String key) {
        ResourceBundle target = ResourceBundle.getBundle(file);
        return target.getString(key);
    }
}
